<?php
require_once("../../inc/global.php");
require_once("function.php");
adminislogin();
$MenuID=$_GET["MenuID"];
$id=$_GET["id"];
if(!isGetRule($MenuID,$_SESSION[ADMINSESSION][0],4) && strtolower($_SESSION[ADMINSESSION][1])!='admin'){

	YKT_error('对不起，你没有操作的权限',$_SERVER['HTTP_REFERER']);
}
//获取表名
$DataTableName=$System->GetTableName($MenuID);
$d=$db->getoners('select '.$DataTableName.'2 from '.$DataTableName.' where '.$DataTableName.'0='.$id.' limit 1');
$msg='';
if(!empty($d[0])){
	$htmlpath=SITEROOT.$d[0];
	if(file_exists($htmlpath)){
		@unlink($htmlpath);
	}
	$msg='静态页面删除成功！';
}
$db->exec("delete from {$DataTableName} where {$DataTableName}0={$id}");
YKT_error('删除成功！'.$msg,$_SERVER['HTTP_REFERER']);

?>